package com.gxjtkyy.datadistributer.writer.rdbms.config;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class TableSetting {
   private String sourceTableName;
   private String targetTableName;
   private boolean updatable = true;
   private boolean dropWhenValueTooLarge = false;
   private boolean dropWhenCannotInsertNull = false;
   private boolean dropWhenValueLargeThanSpecifiedPrecision = false;
   private Set<String> keyColumns = new HashSet();
   private Map<String, String> comparableColumns = new HashMap();
   private Set<String> ignoredColumnsForUpdate = new HashSet();
   private Set<String> ignoredColumnsForInsert = new HashSet();
   private Map<String, String> columnDefaultValues = new HashMap();
   private List<DbRecordFilterConfig> dbRecordFilterConfigs = new ArrayList();

   public String getSourceTableName() {
      return this.sourceTableName;
   }

   public String getTargetTableName() {
      return this.targetTableName;
   }

   public boolean isUpdatable() {
      return this.updatable;
   }

   public boolean isDropWhenValueTooLarge() {
      return this.dropWhenValueTooLarge;
   }

   public boolean isDropWhenCannotInsertNull() {
      return this.dropWhenCannotInsertNull;
   }

   public boolean isDropWhenValueLargeThanSpecifiedPrecision() {
      return this.dropWhenValueLargeThanSpecifiedPrecision;
   }

   public Set<String> getKeyColumns() {
      return this.keyColumns;
   }

   public Map<String, String> getComparableColumns() {
      return this.comparableColumns;
   }

   public Set<String> getIgnoredColumnsForUpdate() {
      return this.ignoredColumnsForUpdate;
   }

   public Set<String> getIgnoredColumnsForInsert() {
      return this.ignoredColumnsForInsert;
   }

   public Map<String, String> getColumnDefaultValues() {
      return this.columnDefaultValues;
   }

   public List<DbRecordFilterConfig> getDbRecordFilterConfigs() {
      return this.dbRecordFilterConfigs;
   }

   public void setSourceTableName(final String sourceTableName) {
      this.sourceTableName = sourceTableName;
   }

   public void setTargetTableName(final String targetTableName) {
      this.targetTableName = targetTableName;
   }

   public void setUpdatable(final boolean updatable) {
      this.updatable = updatable;
   }

   public void setDropWhenValueTooLarge(final boolean dropWhenValueTooLarge) {
      this.dropWhenValueTooLarge = dropWhenValueTooLarge;
   }

   public void setDropWhenCannotInsertNull(final boolean dropWhenCannotInsertNull) {
      this.dropWhenCannotInsertNull = dropWhenCannotInsertNull;
   }

   public void setDropWhenValueLargeThanSpecifiedPrecision(final boolean dropWhenValueLargeThanSpecifiedPrecision) {
      this.dropWhenValueLargeThanSpecifiedPrecision = dropWhenValueLargeThanSpecifiedPrecision;
   }

   public void setKeyColumns(final Set<String> keyColumns) {
      this.keyColumns = keyColumns;
   }

   public void setComparableColumns(final Map<String, String> comparableColumns) {
      this.comparableColumns = comparableColumns;
   }

   public void setIgnoredColumnsForUpdate(final Set<String> ignoredColumnsForUpdate) {
      this.ignoredColumnsForUpdate = ignoredColumnsForUpdate;
   }

   public void setIgnoredColumnsForInsert(final Set<String> ignoredColumnsForInsert) {
      this.ignoredColumnsForInsert = ignoredColumnsForInsert;
   }

   public void setColumnDefaultValues(final Map<String, String> columnDefaultValues) {
      this.columnDefaultValues = columnDefaultValues;
   }

   public void setDbRecordFilterConfigs(final List<DbRecordFilterConfig> dbRecordFilterConfigs) {
      this.dbRecordFilterConfigs = dbRecordFilterConfigs;
   }

   public boolean equals(final Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof TableSetting)) {
         return false;
      } else {
         TableSetting other = (TableSetting)o;
         if (!other.canEqual(this)) {
            return false;
         } else if (this.isUpdatable() != other.isUpdatable()) {
            return false;
         } else if (this.isDropWhenValueTooLarge() != other.isDropWhenValueTooLarge()) {
            return false;
         } else if (this.isDropWhenCannotInsertNull() != other.isDropWhenCannotInsertNull()) {
            return false;
         } else if (this.isDropWhenValueLargeThanSpecifiedPrecision() != other.isDropWhenValueLargeThanSpecifiedPrecision()) {
            return false;
         } else {
            Object this$sourceTableName = this.getSourceTableName();
            Object other$sourceTableName = other.getSourceTableName();
            if (this$sourceTableName == null) {
               if (other$sourceTableName != null) {
                  return false;
               }
            } else if (!this$sourceTableName.equals(other$sourceTableName)) {
               return false;
            }

            Object this$targetTableName = this.getTargetTableName();
            Object other$targetTableName = other.getTargetTableName();
            if (this$targetTableName == null) {
               if (other$targetTableName != null) {
                  return false;
               }
            } else if (!this$targetTableName.equals(other$targetTableName)) {
               return false;
            }

            label103: {
               Object this$keyColumns = this.getKeyColumns();
               Object other$keyColumns = other.getKeyColumns();
               if (this$keyColumns == null) {
                  if (other$keyColumns == null) {
                     break label103;
                  }
               } else if (this$keyColumns.equals(other$keyColumns)) {
                  break label103;
               }

               return false;
            }

            Object this$comparableColumns = this.getComparableColumns();
            Object other$comparableColumns = other.getComparableColumns();
            if (this$comparableColumns == null) {
               if (other$comparableColumns != null) {
                  return false;
               }
            } else if (!this$comparableColumns.equals(other$comparableColumns)) {
               return false;
            }

            label89: {
               Object this$ignoredColumnsForUpdate = this.getIgnoredColumnsForUpdate();
               Object other$ignoredColumnsForUpdate = other.getIgnoredColumnsForUpdate();
               if (this$ignoredColumnsForUpdate == null) {
                  if (other$ignoredColumnsForUpdate == null) {
                     break label89;
                  }
               } else if (this$ignoredColumnsForUpdate.equals(other$ignoredColumnsForUpdate)) {
                  break label89;
               }

               return false;
            }

            label82: {
               Object this$ignoredColumnsForInsert = this.getIgnoredColumnsForInsert();
               Object other$ignoredColumnsForInsert = other.getIgnoredColumnsForInsert();
               if (this$ignoredColumnsForInsert == null) {
                  if (other$ignoredColumnsForInsert == null) {
                     break label82;
                  }
               } else if (this$ignoredColumnsForInsert.equals(other$ignoredColumnsForInsert)) {
                  break label82;
               }

               return false;
            }

            Object this$columnDefaultValues = this.getColumnDefaultValues();
            Object other$columnDefaultValues = other.getColumnDefaultValues();
            if (this$columnDefaultValues == null) {
               if (other$columnDefaultValues != null) {
                  return false;
               }
            } else if (!this$columnDefaultValues.equals(other$columnDefaultValues)) {
               return false;
            }

            Object this$dbRecordFilterConfigs = this.getDbRecordFilterConfigs();
            Object other$dbRecordFilterConfigs = other.getDbRecordFilterConfigs();
            if (this$dbRecordFilterConfigs == null) {
               if (other$dbRecordFilterConfigs != null) {
                  return false;
               }
            } else if (!this$dbRecordFilterConfigs.equals(other$dbRecordFilterConfigs)) {
               return false;
            }

            return true;
         }
      }
   }

   protected boolean canEqual(final Object other) {
      return other instanceof TableSetting;
   }

   public int hashCode() {
//      int PRIME = true;
      int result = 1;
      result = result * 59 + (this.isUpdatable() ? 79 : 97);
      result = result * 59 + (this.isDropWhenValueTooLarge() ? 79 : 97);
      result = result * 59 + (this.isDropWhenCannotInsertNull() ? 79 : 97);
      result = result * 59 + (this.isDropWhenValueLargeThanSpecifiedPrecision() ? 79 : 97);
      Object $sourceTableName = this.getSourceTableName();
      result = result * 59 + ($sourceTableName == null ? 43 : $sourceTableName.hashCode());
      Object $targetTableName = this.getTargetTableName();
      result = result * 59 + ($targetTableName == null ? 43 : $targetTableName.hashCode());
      Object $keyColumns = this.getKeyColumns();
      result = result * 59 + ($keyColumns == null ? 43 : $keyColumns.hashCode());
      Object $comparableColumns = this.getComparableColumns();
      result = result * 59 + ($comparableColumns == null ? 43 : $comparableColumns.hashCode());
      Object $ignoredColumnsForUpdate = this.getIgnoredColumnsForUpdate();
      result = result * 59 + ($ignoredColumnsForUpdate == null ? 43 : $ignoredColumnsForUpdate.hashCode());
      Object $ignoredColumnsForInsert = this.getIgnoredColumnsForInsert();
      result = result * 59 + ($ignoredColumnsForInsert == null ? 43 : $ignoredColumnsForInsert.hashCode());
      Object $columnDefaultValues = this.getColumnDefaultValues();
      result = result * 59 + ($columnDefaultValues == null ? 43 : $columnDefaultValues.hashCode());
      Object $dbRecordFilterConfigs = this.getDbRecordFilterConfigs();
      result = result * 59 + ($dbRecordFilterConfigs == null ? 43 : $dbRecordFilterConfigs.hashCode());
      return result;
   }

   public String toString() {
      String var10000 = this.getSourceTableName();
      return "TableSetting(sourceTableName=" + var10000 + ", targetTableName=" + this.getTargetTableName() + ", updatable=" + this.isUpdatable() + ", dropWhenValueTooLarge=" + this.isDropWhenValueTooLarge() + ", dropWhenCannotInsertNull=" + this.isDropWhenCannotInsertNull() + ", dropWhenValueLargeThanSpecifiedPrecision=" + this.isDropWhenValueLargeThanSpecifiedPrecision() + ", keyColumns=" + this.getKeyColumns() + ", comparableColumns=" + this.getComparableColumns() + ", ignoredColumnsForUpdate=" + this.getIgnoredColumnsForUpdate() + ", ignoredColumnsForInsert=" + this.getIgnoredColumnsForInsert() + ", columnDefaultValues=" + this.getColumnDefaultValues() + ", dbRecordFilterConfigs=" + this.getDbRecordFilterConfigs() + ")";
   }
}
